<template>
{{#if page.psSysPFPlugin}}
  	{{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
  	<AppViewLayout :class="classNames">
		<template v-if="!noViewCaption && model.showCaption"  #viewHeaderCenter>
			<div class="view-header__center__caption">
                {{> @macro/view/view-caption.hbs}}
            </div>
		</template>
		{{> @macro/view/view-toolbar.hbs page=page}}
		<template #default>
			<AppExpBarContainer sideBarLayout="{{page.sideBarLayout}}" class="app-vc-expbar">
				<template #left>
					<div class="app-vc-expbar__left">
                    {{#page.ctrls}}
                    {{#eq controlType 'LISTEXPBAR'}}
                        {{> @macro/widgets/list-exp-bar-detail/list-exp-bar.hbs ctrl=ctrl page=page}}
                    {{/eq}}
                    {{/page.ctrls}}
					</div>
				</template>
				<template #right>
					<div class="app-vc-expbar__body">
						<component
							v-if="store.navParam && store.navParam.navViewName"
							:is="store.navParam.navViewName"
							:key="store.navParam.data.srfkey"
							:context="store.navParam.srfnavdata.context"
							:viewParams="store.navParam.srfnavdata.viewParams"
							openType="EMBED"
							:pLoadingHelper="store.loadingHelper"
							class="view-container2"
							@view-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data); }"
							@view-init="(name:string, data:any) => { handleCtrlInit(controller, name, data); }"
							@view-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data); }">
						</component>
					</div>
       	 		</template>
      		</AppExpBarContainer>
    	</template>
		{{> @macro/view/view-msg.hbs}}  
	</AppViewLayout>
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div>
    {{/if}}
{{/if}}
</template>

// 基于template/src/views/\{{appModules}}/\{{pages@DELISTEXPVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
<script lang="ts" setup>
{{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppViewLayout } from "@components/layout/view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { AppExpBarContainer } from '@components/common/exp-bar-container';
import {
	useNavParamsBind,
	useEventBind,
{{#page.ctrls}}
  {{#eq controlType 'TOOLBAR'}}
  	handleToolbarItemClick,
  {{/eq}}
{{/page.ctrls}}
	handleCtrlAction,
	handleCtrlInit,
	handleCtrlDestroy,
	getViewBackVisible,
    getViewClassNames,
{{#unless page.psViewLayoutPanel.useDefaultLayout}}
    handleComponentAction,
{{/unless}}
} from "@/hooks/use-view";
import { ListExpViewActionType, IParam, IContext, IListExpViewAbility, IListExpViewControllerParams, IListExpViewStore, ListExpViewController, IListExpViewController, ILoadingHelper } from '@/core';
{{> @macro/view/view-props.hbs}}

{{> @macro/common/emit.hbs name="view" actionType="ListExpViewActionType" ability="IListExpViewAbility"}}

{{> @macro/view/view-common.hbs}}

const params: IListExpViewControllerParams<ListExpViewActionType, IListExpViewAbility> = {
    name: props.name,
	model,
	evt,
	isLoadDefault: props.isLoadDefault,
	openType: props.openType,
	pLoadingHelper: props.pLoadingHelper,
	handler: (data: IListExpViewStore) => { return reactive(data); }
};


{{> @macro/common/controller.hbs name="view" IController="IListExpViewController" store="IListExpViewStore" ability="IListExpViewAbility" controller="ListExpViewController" }}
</script>